<html>
<head>
  <title>../ex10.cxx</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<a href="../ex10.cxx">download the original source code</a>.
<pre>
<a name="line1">  1</a> <font color="#444444">/*
<a name="line2">  2</a>    Example 10
<a name="line3">  3</a> 
<a name="line4">  4</a>    Interface:      Finite Element Interface (FEI)
<a name="line5">  5</a> 
<a name="line6">  6</a>    Compile with:   make ex10
<a name="line7">  7</a> 
<a name="line8">  8</a>    Sample run:     mpirun -np 4 ex10 -n 120 -solver 2
<a name="line9">  9</a> 
<a name="line10"> 10</a>    To see options: ex10 -help
<a name="line11"> 11</a> 
<a name="line12"> 12</a>    Description:    This code solves a system corresponding to a discretization
<a name="line13"> 13</a>                    of the Laplace equation -Delta u = 1 with zero boundary
<a name="line14"> 14</a>                    conditions on the unit square.  The domain is split into
<a name="line15"> 15</a>                    a n x n grid of quadrilateral elements and each processors
<a name="line16"> 16</a>                    owns a horizontal strip of size m x n, where m = n/nprocs. We
<a name="line17"> 17</a>                    use bilinear finite element discretization, so there are
<a name="line18"> 18</a>                    nodes (vertices) that are shared between neighboring
<a name="line19"> 19</a>                    processors. The Finite Element Interface is used to assemble
<a name="line20"> 20</a>                    the matrix and solve the problem. Nine different solvers are
<a name="line21"> 21</a>                    available.
<a name="line22"> 22</a> */</font>
<a name="line23"> 23</a> 
<a name="line24"> 24</a> <font color="0000ff"><strong>#include <font color="#008000">&lt;math.h&gt;</font></strong></font>
<a name="line25"> 25</a> <font color="0000ff"><strong>#include <font color="#008000">&lt;iostream&gt;</font></strong></font>
<a name="line26"> 26</a> <font color="0000ff"><strong>#include <font color="#008000">&lt;fstream&gt;</font></strong></font>
<a name="line27"> 27</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;_hypre_utilities.h&quot;</font></strong></font>
<a name="line28"> 28</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;LLNL_FEI_Impl.h&quot;</font></strong></font>
<a name="line29"> 29</a> 
<a name="line30"> 30</a> <strong>using</strong> <strong>namespace</strong> <font color="#2040a0">std</font><font color="4444FF">;</font>
<a name="line31"> 31</a> 
<a name="line32"> 32</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;vis.c&quot;</font></strong></font>
<a name="line33"> 33</a> 
<a name="line34"> 34</a> <strong>int</strong> <font color="#2040a0">main</font><font color="4444FF">(</font><strong>int</strong> <font color="#2040a0">argc</font>, <strong>char</strong> <font color="4444FF">*</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="4444FF">]</font><font color="4444FF">)</font>
<a name="line35"> 35</a> <font color="4444FF"><strong>{</strong></font>
<a name="line36"> 36</a>    <strong>int</strong> <font color="#2040a0">i</font>, <font color="#2040a0">j</font>, <font color="#2040a0">k</font><font color="4444FF">;</font>
<a name="line37"> 37</a> 
<a name="line38"> 38</a>    <strong>int</strong> <font color="#2040a0">nprocs</font>, <font color="#2040a0">mypid</font><font color="4444FF">;</font>
<a name="line39"> 39</a> 
<a name="line40"> 40</a>    <strong>int</strong> <font color="#2040a0">n</font>, <font color="#2040a0">m</font>, <font color="#2040a0">offset</font><font color="4444FF">;</font>
<a name="line41"> 41</a>    <strong>double</strong> <font color="#2040a0">h</font><font color="4444FF">;</font>
<a name="line42"> 42</a> 
<a name="line43"> 43</a>    <strong>int</strong> <font color="#2040a0">solverID</font><font color="4444FF">;</font>
<a name="line44"> 44</a>    <strong>int</strong> <font color="#2040a0">vis</font><font color="4444FF">;</font>
<a name="line45"> 45</a> 
<a name="line46"> 46</a>    <font color="#444444">// Initialize MPI</font>
<a name="line47"> 47</a>    <font color="#2040a0">MPI_Init</font><font color="4444FF">(</font><font color="4444FF">&amp;</font><font color="#2040a0">argc</font>, <font color="4444FF">&amp;</font><font color="#2040a0">argv</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line48"> 48</a>    <font color="#2040a0">MPI_Comm_size</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="4444FF">&amp;</font><font color="#2040a0">nprocs</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line49"> 49</a>    <font color="#2040a0">MPI_Comm_rank</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="4444FF">&amp;</font><font color="#2040a0">mypid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line50"> 50</a> 
<a name="line51"> 51</a>    <font color="#444444">// Set default parameters</font>
<a name="line52"> 52</a>    <font color="#2040a0">n</font> <font color="4444FF">=</font> <font color="#FF0000">4</font><font color="4444FF">*</font><font color="#2040a0">nprocs</font><font color="4444FF">;</font>
<a name="line53"> 53</a>    <font color="#2040a0">solverID</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line54"> 54</a>    <font color="#2040a0">vis</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line55"> 55</a> 
<a name="line56"> 56</a>    <font color="#444444">// Parse command line</font>
<a name="line57"> 57</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line58"> 58</a>       <strong>int</strong> <font color="#2040a0">arg_index</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line59"> 59</a>       <strong>int</strong> <font color="#2040a0">print_usage</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line60"> 60</a> 
<a name="line61"> 61</a>       <strong>while</strong> <font color="4444FF">(</font><font color="#2040a0">arg_index</font> <font color="4444FF">&lt;</font> <font color="#2040a0">argc</font><font color="4444FF">)</font>
<a name="line62"> 62</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line63"> 63</a>          <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-n&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line64"> 64</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line65"> 65</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line66"> 66</a>             <font color="#2040a0">n</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line67"> 67</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line68"> 68</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-solver&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line69"> 69</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line70"> 70</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line71"> 71</a>             <font color="#2040a0">solverID</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line72"> 72</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line73"> 73</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-vis&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line74"> 74</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line75"> 75</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line76"> 76</a>             <font color="#2040a0">vis</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line77"> 77</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line78"> 78</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-help&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line79"> 79</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line80"> 80</a>             <font color="#2040a0">print_usage</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line81"> 81</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line82"> 82</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line83"> 83</a>          <strong>else</strong>
<a name="line84"> 84</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line85"> 85</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line86"> 86</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line87"> 87</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line88"> 88</a> 
<a name="line89"> 89</a>       <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">print_usage</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">)</font>
<a name="line90"> 90</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line91"> 91</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line92"> 92</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Usage: %s [&lt;options&gt;]<font color="#77dd77">\n</font>&quot;</font>, <font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line93"> 93</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line94"> 94</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -n &lt;n&gt;              : problem size per processor (default: %d)<font color="#77dd77">\n</font>&quot;</font>, <font color="#FF0000">4</font><font color="4444FF">*</font><font color="#2040a0">nprocs</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line95"> 95</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -solver &lt;ID&gt;        : solver ID<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line96"> 96</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        0 - DS-PCG<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line97"> 97</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        1 - ParaSails-PCG<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line98"> 98</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        2 - AMG-PCG (default)<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line99"> 99</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        3 - AMGSA-PCG<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line100">100</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        4 - Euclid-PCG<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line101">101</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        5 - DS-GMRES<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line102">102</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        6 - AMG-GMRES<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line103">103</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        7 - AMGSA-GMRES<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line104">104</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;                        8 - Euclid-GMRES<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line105">105</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -print_solution     : print the solution vector<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line106">106</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line107">107</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line108">108</a> 
<a name="line109">109</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">print_usage</font><font color="4444FF">)</font>
<a name="line110">110</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line111">111</a>          <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line112">112</a>          <strong>return</strong> <font color="4444FF">(</font><font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line113">113</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line114">114</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line115">115</a> 
<a name="line116">116</a>    <font color="#444444">// Each processor owns a m x n grid of quadrilateral finite elements.</font>
<a name="line117">117</a>    <font color="#444444">// The unknowns are located in the nodes (vertices of the mesh) and</font>
<a name="line118">118</a>    <font color="#444444">// are numbered globally starting from the lower left corner and moving</font>
<a name="line119">119</a>    <font color="#444444">// row-wise to the upper right corner.</font>
<a name="line120">120</a>    <font color="#2040a0">m</font> <font color="4444FF">=</font> <font color="#2040a0">n</font> / <font color="#2040a0">nprocs</font><font color="4444FF">;</font>
<a name="line121">121</a>    <font color="#2040a0">offset</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">m</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line122">122</a> 
<a name="line123">123</a>    <font color="#2040a0">h</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font> / <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#444444">// mesh size</font>
<a name="line124">124</a> 
<a name="line125">125</a>    <font color="#444444">// 1. FEI initialization phase</font>
<a name="line126">126</a> 
<a name="line127">127</a>    <font color="#444444">// Instantiate the FEI object</font>
<a name="line128">128</a>    <font color="#2040a0">LLNL_FEI_Impl</font> <font color="4444FF">*</font><font color="#2040a0">feiPtr</font> <font color="4444FF">=</font> <strong>new</strong> <font color="#2040a0">LLNL_FEI_Impl</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line129">129</a> 
<a name="line130">130</a>    <font color="#444444">// Set the matrix storage type to HYPRE</font>
<a name="line131">131</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line132">132</a>       <strong>char</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">paramStrings</font> <font color="4444FF">=</font> <strong>new</strong> <strong>char</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line133">133</a>       <font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>char</strong><font color="4444FF">[</font><font color="#FF0000">100</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line134">134</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font>, <font color="#008000">&quot;externalSolver HYPRE&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line135">135</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">parameters</font><font color="4444FF">(</font><font color="#FF0000">1</font>, <font color="#2040a0">paramStrings</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line136">136</a>       <strong>delete</strong> <font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line137">137</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">paramStrings</font><font color="4444FF">;</font>
<a name="line138">138</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line139">139</a> 
<a name="line140">140</a>    <font color="#444444">// The unknowns in FEI are called fields. Each field has an</font>
<a name="line141">141</a>    <font color="#444444">// identifier (fieldID) and rank (fieldSize).</font>
<a name="line142">142</a>    <strong>int</strong> <font color="#2040a0">nFields</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line143">143</a>    <strong>int</strong> <font color="4444FF">*</font><font color="#2040a0">fieldSizes</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nFields</font><font color="4444FF">]</font><font color="4444FF">;</font>  <font color="#2040a0">fieldSizes</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line144">144</a>    <strong>int</strong> <font color="4444FF">*</font><font color="#2040a0">fieldIDs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nFields</font><font color="4444FF">]</font><font color="4444FF">;</font>    <font color="#2040a0">fieldIDs</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line145">145</a> 
<a name="line146">146</a>    <font color="#444444">// Pass the field information to the FEI</font>
<a name="line147">147</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">initFields</font><font color="4444FF">(</font><font color="#2040a0">nFields</font>, <font color="#2040a0">fieldSizes</font>, <font color="#2040a0">fieldIDs</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line148">148</a> 
<a name="line149">149</a>    <font color="#444444">// Elements are grouped into blocks (in this case one block), and we</font>
<a name="line150">150</a>    <font color="#444444">// have to describe the number of elements in the block (nElems) as</font>
<a name="line151">151</a>    <font color="#444444">// well as the fields (unknowns) per element.</font>
<a name="line152">152</a>    <strong>int</strong> <font color="#2040a0">elemBlkID</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line153">153</a>    <strong>int</strong> <font color="#2040a0">nElems</font> <font color="4444FF">=</font> <font color="#2040a0">m</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line154">154</a>    <strong>int</strong> <font color="#2040a0">elemNNodes</font> <font color="4444FF">=</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#444444">// number of (shared) nodes per element</font>
<a name="line155">155</a>    <strong>int</strong> <font color="4444FF">*</font><font color="#2040a0">nodeNFields</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font> <font color="#444444">// fields per node</font>
<a name="line156">156</a>    <strong>int</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">nodeFieldIDs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font> <font color="#444444">// node-fields IDs</font>
<a name="line157">157</a>    <strong>int</strong> <font color="#2040a0">elemNFields</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#444444">// number of (non-shared) fields per element</font>
<a name="line158">158</a>    <strong>int</strong> <font color="4444FF">*</font><font color="#2040a0">elemFieldIDs</font> <font color="4444FF">=</font> <font color="#2040a0">NULL</font><font color="4444FF">;</font> <font color="#444444">// element-fields IDs</font>
<a name="line159">159</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">elemNNodes</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line160">160</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line161">161</a>       <font color="#2040a0">nodeNFields</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line162">162</a>       <font color="#2040a0">nodeFieldIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nodeNFields</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line163">163</a>       <font color="#2040a0">nodeFieldIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">fieldIDs</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line164">164</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line165">165</a> 
<a name="line166">166</a>    <font color="#444444">// Pass the block information to the FEI. The interleave parameter</font>
<a name="line167">167</a>    <font color="#444444">// controls how different fields are ordered in the element matrices.</font>
<a name="line168">168</a>    <strong>int</strong> <font color="#2040a0">interleave</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line169">169</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">initElemBlock</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="#2040a0">nElems</font>, <font color="#2040a0">elemNNodes</font>, <font color="#2040a0">nodeNFields</font>,
<a name="line170">170</a>                          <font color="#2040a0">nodeFieldIDs</font>, <font color="#2040a0">elemNFields</font>, <font color="#2040a0">elemFieldIDs</font>, <font color="#2040a0">interleave</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line171">171</a> 
<a name="line172">172</a>    <font color="#444444">// List the global indexes (IDs) of the nodes in each element</font>
<a name="line173">173</a>    <strong>int</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">elemConn</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nElems</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line174">174</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">m</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line175">175</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line176">176</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line177">177</a>          <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font> <font color="#444444">// element with coordinates (i,j)</font>
<a name="line178">178</a>          <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">;</font>     <font color="#444444">// node in the lower left</font>
<a name="line179">179</a>          <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>   <font color="#444444">// node in the lower right</font>
<a name="line180">180</a>          <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#444444">// node in the upper right</font>
<a name="line181">181</a>          <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF">;</font>   <font color="#444444">// node in the upper left</font>
<a name="line182">182</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line183">183</a> 
<a name="line184">184</a>    <font color="#444444">// Pass the element topology information to the FEI</font>
<a name="line185">185</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nElems</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line186">186</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">initElem</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="#2040a0">i</font>, <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line187">187</a> 
<a name="line188">188</a>    <font color="#444444">// List the global indexes of nodes that are shared between processors</font>
<a name="line189">189</a>    <strong>int</strong> <font color="#2040a0">nShared</font>, <font color="4444FF">*</font><font color="#2040a0">SharedIDs</font>, <font color="4444FF">*</font><font color="#2040a0">SharedLengs</font>, <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">SharedProcs</font><font color="4444FF">;</font>
<a name="line190">190</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line191">191</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line192">192</a>       <font color="#444444">// Nodes in the top row are shared</font>
<a name="line193">193</a>       <font color="#2040a0">nShared</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line194">194</a>       <font color="#2040a0">SharedIDs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line195">195</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line196">196</a>          <font color="#2040a0">SharedIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">m</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line197">197</a>       <font color="#2040a0">SharedLengs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line198">198</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line199">199</a>          <font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line200">200</a>       <font color="#2040a0">SharedProcs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line201">201</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line202">202</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line203">203</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line204">204</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">;</font>
<a name="line205">205</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line206">206</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line207">207</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line208">208</a>    <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">nprocs</font><font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF">)</font>
<a name="line209">209</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line210">210</a>       <font color="#444444">// Nodes in the bottom row are shared</font>
<a name="line211">211</a>       <font color="#2040a0">nShared</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line212">212</a>       <font color="#2040a0">SharedIDs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line213">213</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line214">214</a>          <font color="#2040a0">SharedIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line215">215</a>       <font color="#2040a0">SharedLengs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line216">216</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line217">217</a>          <font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line218">218</a>       <font color="#2040a0">SharedProcs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line219">219</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line220">220</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line221">221</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line222">222</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line223">223</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">;</font>
<a name="line224">224</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line225">225</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line226">226</a>    <strong>else</strong>
<a name="line227">227</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line228">228</a>       <font color="#444444">// Nodes in the top and bottom rows are shared</font>
<a name="line229">229</a>       <font color="#2040a0">nShared</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line230">230</a>       <font color="#2040a0">SharedIDs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line231">231</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line232">232</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line233">233</a>          <font color="#2040a0">SharedIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line234">234</a>          <font color="#2040a0">SharedIDs</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">m</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line235">235</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line236">236</a>       <font color="#2040a0">SharedLengs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line237">237</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line238">238</a>          <font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line239">239</a>       <font color="#2040a0">SharedProcs</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nShared</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line240">240</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line241">241</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line242">242</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line243">243</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line244">244</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">;</font>
<a name="line245">245</a> 
<a name="line246">246</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">SharedLengs</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line247">247</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">;</font>
<a name="line248">248</a>          <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">mypid</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line249">249</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line250">250</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line251">251</a> 
<a name="line252">252</a>    <font color="#444444">// Pass the shared nodes information to the FEI</font>
<a name="line253">253</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">nprocs</font> <font color="4444FF">!</font><font color="4444FF">=</font> <font color="#FF0000">1</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="#2040a0">nShared</font> <font color="4444FF">&gt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line254">254</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">initSharedNodes</font><font color="4444FF">(</font><font color="#2040a0">nShared</font>, <font color="#2040a0">SharedIDs</font>, <font color="#2040a0">SharedLengs</font>, <font color="#2040a0">SharedProcs</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line255">255</a> 
<a name="line256">256</a>    <font color="#444444">// Finish the FEI initialization phase</font>
<a name="line257">257</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">initComplete</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line258">258</a> 
<a name="line259">259</a>    <font color="#444444">// 2. FEI load phase</font>
<a name="line260">260</a> 
<a name="line261">261</a>    <font color="#444444">// Specify the boundary conditions</font>
<a name="line262">262</a>    <strong>int</strong> <font color="#2040a0">nBCs</font>, <font color="4444FF">*</font><font color="#2040a0">BCEqn</font><font color="4444FF">;</font>
<a name="line263">263</a>    <strong>double</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">alpha</font>, <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">beta</font>, <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">gamma</font><font color="4444FF">;</font>
<a name="line264">264</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line265">265</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line266">266</a>       <font color="#444444">// Nodes in the bottom row and left and right columns</font>
<a name="line267">267</a>       <font color="#2040a0">nBCs</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">m</font><font color="4444FF">;</font>
<a name="line268">268</a>       <font color="#2040a0">BCEqn</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line269">269</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line270">270</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line271">271</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">m</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line272">272</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line273">273</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="4444FF">(</font><font color="#2040a0">i</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line274">274</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="4444FF">(</font><font color="#2040a0">i</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line275">275</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line276">276</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line277">277</a>    <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">nprocs</font><font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF">)</font>
<a name="line278">278</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line279">279</a>       <font color="#444444">// Nodes in the top row and left and right columns</font>
<a name="line280">280</a>       <font color="#2040a0">nBCs</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">m</font><font color="4444FF">;</font>
<a name="line281">281</a>       <font color="#2040a0">BCEqn</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line282">282</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line283">283</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">m</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line284">284</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">m</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line285">285</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line286">286</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line287">287</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">+</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line288">288</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line289">289</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line290">290</a>    <strong>else</strong>
<a name="line291">291</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line292">292</a>       <font color="#444444">// Nodes in the left and right columns</font>
<a name="line293">293</a>       <font color="#2040a0">nBCs</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">m</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line294">294</a>       <font color="#2040a0">BCEqn</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line295">295</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">m</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line296">296</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line297">297</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font>   <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line298">298</a>          <font color="#2040a0">BCEqn</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">offset</font> <font color="4444FF">+</font> <font color="#2040a0">i</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line299">299</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line300">300</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line301">301</a> 
<a name="line302">302</a>    <font color="#444444">// The arrays alpha, beta and gamma specify the type of boundary</font>
<a name="line303">303</a>    <font color="#444444">// condition (essential, natural, mixed). The most general form</font>
<a name="line304">304</a>    <font color="#444444">// for Laplace problems is alpha U + beta dU/dn = gamma. In this</font>
<a name="line305">305</a>    <font color="#444444">// example we impose zero Dirichlet boundary conditions.</font>
<a name="line306">306</a>    <font color="#2040a0">alpha</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line307">307</a>    <font color="#2040a0">beta</font>  <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line308">308</a>    <font color="#2040a0">gamma</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nBCs</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line309">309</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nBCs</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line310">310</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line311">311</a>       <font color="#2040a0">alpha</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">;</font>  <font color="#2040a0">alpha</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line312">312</a>       <font color="#2040a0">beta</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font>  <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">;</font>  <font color="#2040a0">beta</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font>  <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line313">313</a>       <font color="#2040a0">gamma</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">;</font>  <font color="#2040a0">gamma</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line314">314</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line315">315</a> 
<a name="line316">316</a>    <font color="#444444">// Pass the boundary condition information to the FEI</font>
<a name="line317">317</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">loadNodeBCs</font><font color="4444FF">(</font><font color="#2040a0">nBCs</font>, <font color="#2040a0">BCEqn</font>, <font color="#2040a0">fieldIDs</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font>, <font color="#2040a0">alpha</font>, <font color="#2040a0">beta</font>, <font color="#2040a0">gamma</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line318">318</a> 
<a name="line319">319</a>    <font color="#444444">// Specify element stiffness matrices</font>
<a name="line320">320</a>    <strong>double</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">elemStiff</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nElems</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line321">321</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">m</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line322">322</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line323">323</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line324">324</a>          <font color="#444444">// Element with coordinates (i,j)</font>
<a name="line325">325</a>          <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line326">326</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">k</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">k</font> <font color="4444FF">&lt;</font> <font color="#2040a0">elemNNodes</font><font color="4444FF">;</font> <font color="#2040a0">k</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line327">327</a>             <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">k</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line328">328</a> 
<a name="line329">329</a>          <font color="#444444">// Stiffness matrix for the reference square</font>
<a name="line330">330</a>          <font color="#444444">//                3 +---+ 2</font>
<a name="line331">331</a>          <font color="#444444">//                  |   |</font>
<a name="line332">332</a>          <font color="#444444">//                0 +---+ 1</font>
<a name="line333">333</a> 
<a name="line334">334</a>          <strong>double</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">A</font> <font color="4444FF">=</font> <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line335">335</a> 
<a name="line336">336</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">k</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">k</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">k</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line337">337</a>             <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#2040a0">k</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">k</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">2</font>/<font color="#FF0000">3</font>.<font color="4444FF">;</font>
<a name="line338">338</a> 
<a name="line339">339</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">6</font>.<font color="4444FF">;</font>
<a name="line340">340</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">3</font>.<font color="4444FF">;</font>
<a name="line341">341</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">6</font>.<font color="4444FF">;</font>
<a name="line342">342</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">6</font>.<font color="4444FF">;</font>
<a name="line343">343</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">3</font>.<font color="4444FF">;</font>
<a name="line344">344</a>          <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">A</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1</font>/<font color="#FF0000">6</font>.<font color="4444FF">;</font>
<a name="line345">345</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line346">346</a> 
<a name="line347">347</a>    <font color="#444444">// Specify element load vectors</font>
<a name="line348">348</a>    <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">elemLoad</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#2040a0">nElems</font><font color="4444FF">*</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line349">349</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nElems</font><font color="4444FF">*</font><font color="#2040a0">elemNNodes</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line350">350</a>       <font color="#2040a0">elemLoad</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">h</font><font color="4444FF">*</font><font color="#2040a0">h</font>/<font color="#FF0000">4</font><font color="4444FF">;</font>
<a name="line351">351</a> 
<a name="line352">352</a>    <font color="#444444">// Assemble the matrix. The elemFormat parameter describes</font>
<a name="line353">353</a>    <font color="#444444">// the storage (symmetric/non-symmetric, row/column-wise)</font>
<a name="line354">354</a>    <font color="#444444">// of the element stiffness matrices.</font>
<a name="line355">355</a>    <strong>int</strong> <font color="#2040a0">elemFormat</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line356">356</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nElems</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line357">357</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">sumInElem</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="#2040a0">i</font>, <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font>, <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font>,
<a name="line358">358</a>                         <font color="4444FF">&amp;</font><font color="4444FF">(</font><font color="#2040a0">elemLoad</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">*</font><font color="#2040a0">elemNNodes</font><font color="4444FF">]</font><font color="4444FF">)</font>, <font color="#2040a0">elemFormat</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line359">359</a> 
<a name="line360">360</a>    <font color="#444444">// Finish the FEI load phase</font>
<a name="line361">361</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">loadComplete</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line362">362</a> 
<a name="line363">363</a>    <font color="#444444">// Clean up</font>
<a name="line364">364</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nElems</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemConn</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line365">365</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemConn</font><font color="4444FF">;</font>
<a name="line366">366</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nElems</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line367">367</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line368">368</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font> <font color="#2040a0">elemNNodes</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line369">369</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemStiff</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line370">370</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line371">371</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemStiff</font><font color="4444FF">;</font>
<a name="line372">372</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">elemLoad</font><font color="4444FF">;</font>
<a name="line373">373</a> 
<a name="line374">374</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">BCEqn</font><font color="4444FF">;</font>
<a name="line375">375</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nBCs</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line376">376</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line377">377</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">alpha</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line378">378</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">beta</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line379">379</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">gamma</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line380">380</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line381">381</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">alpha</font><font color="4444FF">;</font>
<a name="line382">382</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">beta</font><font color="4444FF">;</font>
<a name="line383">383</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">gamma</font><font color="4444FF">;</font>
<a name="line384">384</a> 
<a name="line385">385</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">nShared</font> <font color="4444FF">&gt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line386">386</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line387">387</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">SharedIDs</font><font color="4444FF">;</font>
<a name="line388">388</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">SharedLengs</font><font color="4444FF">;</font>
<a name="line389">389</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nShared</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">SharedProcs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line390">390</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">SharedProcs</font><font color="4444FF">;</font>
<a name="line391">391</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line392">392</a> 
<a name="line393">393</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">nodeNFields</font><font color="4444FF">;</font>
<a name="line394">394</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">elemNNodes</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">nodeFieldIDs</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line395">395</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">nodeFieldIDs</font><font color="4444FF">;</font>
<a name="line396">396</a> 
<a name="line397">397</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">fieldSizes</font><font color="4444FF">;</font>
<a name="line398">398</a>    <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">fieldIDs</font><font color="4444FF">;</font>
<a name="line399">399</a> 
<a name="line400">400</a>    <font color="#444444">// 3. Set up problem parameters and pass them to the FEI</font>
<a name="line401">401</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line402">402</a>       <strong>int</strong> <font color="#2040a0">nParams</font> <font color="4444FF">=</font> <font color="#FF0000">19</font><font color="4444FF">;</font>
<a name="line403">403</a>       <strong>char</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="#2040a0">paramStrings</font> <font color="4444FF">=</font> <strong>new</strong> <strong>char</strong><font color="4444FF">*</font><font color="4444FF">[</font><font color="#2040a0">nParams</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line404">404</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nParams</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line405">405</a>          <font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <strong>new</strong> <strong>char</strong><font color="4444FF">[</font><font color="#FF0000">100</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line406">406</a> 
<a name="line407">407</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font>, <font color="#008000">&quot;outputLevel 2&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line408">408</a>       <strong>switch</strong><font color="4444FF">(</font><font color="#2040a0">solverID</font><font color="4444FF">)</font>
<a name="line409">409</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line410">410</a>          <strong>case</strong> <font color="#FF0000">0</font><font color="4444FF">:</font>
<a name="line411">411</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver cg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line412">412</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner diagonal&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line413">413</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line414">414</a>          <strong>case</strong> <font color="#FF0000">1</font><font color="4444FF">:</font>
<a name="line415">415</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver cg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line416">416</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner parasails&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line417">417</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line418">418</a>          <strong>default</strong><font color="4444FF">:</font>
<a name="line419">419</a>          <strong>case</strong> <font color="#FF0000">2</font><font color="4444FF">:</font>
<a name="line420">420</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver cg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line421">421</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner boomeramg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line422">422</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line423">423</a>          <strong>case</strong> <font color="#FF0000">3</font><font color="4444FF">:</font>
<a name="line424">424</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver cg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line425">425</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner mli&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line426">426</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line427">427</a>          <strong>case</strong> <font color="#FF0000">4</font><font color="4444FF">:</font>
<a name="line428">428</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver cg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line429">429</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner euclid&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line430">430</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line431">431</a>          <strong>case</strong> <font color="#FF0000">5</font><font color="4444FF">:</font>
<a name="line432">432</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver gmres&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line433">433</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner diagonal&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line434">434</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line435">435</a>          <strong>case</strong> <font color="#FF0000">6</font><font color="4444FF">:</font>
<a name="line436">436</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver gmres&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line437">437</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner boomeramg&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line438">438</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line439">439</a>          <strong>case</strong> <font color="#FF0000">7</font><font color="4444FF">:</font>
<a name="line440">440</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver gmres&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line441">441</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner mli&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line442">442</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line443">443</a>          <strong>case</strong> <font color="#FF0000">8</font><font color="4444FF">:</font>
<a name="line444">444</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#008000">&quot;solver gmres&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line445">445</a>             <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#008000">&quot;preconditioner euclid&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line446">446</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line447">447</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line448">448</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font>, <font color="#008000">&quot;maxIterations 100&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line449">449</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font>, <font color="#008000">&quot;tolerance 1e-6&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line450">450</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">5</font><font color="4444FF">]</font>, <font color="#008000">&quot;gmresDim 30&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line451">451</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">6</font><font color="4444FF">]</font>, <font color="#008000">&quot;amgNumSweeps 1&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line452">452</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">7</font><font color="4444FF">]</font>, <font color="#008000">&quot;amgCoarsenType falgout&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line453">453</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">8</font><font color="4444FF">]</font>, <font color="#008000">&quot;amgRelaxType hybridsym&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line454">454</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">9</font><font color="4444FF">]</font>, <font color="#008000">&quot;amgSystemSize 1&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line455">455</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font>, <font color="#008000">&quot;amgStrongThreshold 0.25&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line456">456</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI smoother HSGS&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line457">457</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI numSweeps 1&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line458">458</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">13</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI smootherWeight 1.0&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line459">459</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">14</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI nodeDOF 1&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line460">460</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">15</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI nullSpaceDim 1&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line461">461</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">16</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI minCoarseSize 50&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line462">462</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">17</font><font color="4444FF">]</font>, <font color="#008000">&quot;MLI outputLevel 0&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line463">463</a>       <font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#FF0000">18</font><font color="4444FF">]</font>, <font color="#008000">&quot;parasailsSymmetric outputLevel 0&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line464">464</a> 
<a name="line465">465</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">parameters</font><font color="4444FF">(</font><font color="#2040a0">nParams</font>, <font color="#2040a0">paramStrings</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line466">466</a> 
<a name="line467">467</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nParams</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line468">468</a>          <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">paramStrings</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line469">469</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">paramStrings</font><font color="4444FF">;</font>
<a name="line470">470</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line471">471</a> 
<a name="line472">472</a>    <font color="#444444">// 4. Solve the system</font>
<a name="line473">473</a>    <strong>int</strong> <font color="#2040a0">status</font><font color="4444FF">;</font>
<a name="line474">474</a>    <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">solve</font><font color="4444FF">(</font><font color="4444FF">&amp;</font><font color="#2040a0">status</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line475">475</a> 
<a name="line476">476</a>    <font color="#444444">// 5. Save the solution for GLVis visualization, see vis/glvis-ex10.sh</font>
<a name="line477">477</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">vis</font><font color="4444FF">)</font>
<a name="line478">478</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line479">479</a>       <strong>int</strong> <font color="#2040a0">numNodes</font>, <font color="4444FF">*</font><font color="#2040a0">nodeIDList</font>, <font color="4444FF">*</font><font color="#2040a0">solnOffsets</font><font color="4444FF">;</font>
<a name="line480">480</a>       <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">solnValues</font><font color="4444FF">;</font>
<a name="line481">481</a> 
<a name="line482">482</a>       <font color="#444444">// Get the number of nodes in the element block</font>
<a name="line483">483</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">getNumBlockActNodes</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="4444FF">&amp;</font><font color="#2040a0">numNodes</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line484">484</a> 
<a name="line485">485</a>       <font color="#444444">// Get their global IDs</font>
<a name="line486">486</a>       <font color="#2040a0">nodeIDList</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">numNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line487">487</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">getBlockNodeIDList</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="#2040a0">numNodes</font>, <font color="#2040a0">nodeIDList</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line488">488</a> 
<a name="line489">489</a>       <font color="#444444">// Get the values corresponding to nodeIDList</font>
<a name="line490">490</a>       <font color="#2040a0">solnOffsets</font> <font color="4444FF">=</font> <strong>new</strong> <strong>int</strong><font color="4444FF">[</font><font color="#2040a0">numNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line491">491</a>       <font color="#2040a0">solnValues</font> <font color="4444FF">=</font> <strong>new</strong> <strong>double</strong><font color="4444FF">[</font><font color="#2040a0">numNodes</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line492">492</a>       <font color="#2040a0">feiPtr</font><font color="4444FF">-</font><font color="4444FF">&gt;</font><font color="#2040a0">getBlockNodeSolution</font><font color="4444FF">(</font><font color="#2040a0">elemBlkID</font>, <font color="#2040a0">numNodes</font>, <font color="#2040a0">nodeIDList</font>,
<a name="line493">493</a>                                    <font color="#2040a0">solnOffsets</font>, <font color="#2040a0">solnValues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line494">494</a> 
<a name="line495">495</a>       <font color="#444444">// Find the location of the ith local node</font>
<a name="line496">496</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">numNodes</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line497">497</a>          <font color="#2040a0">solnOffsets</font><font color="4444FF">[</font><font color="#2040a0">nodeIDList</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">-</font><font color="#2040a0">offset</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line498">498</a> 
<a name="line499">499</a>       <font color="#444444">// Save the ordered nodal values to a file</font>
<a name="line500">500</a>       <strong>char</strong> <font color="#2040a0">sol_out</font><font color="4444FF">[</font><font color="#FF0000">20</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line501">501</a>       <font color="#2040a0">sprintf</font><font color="4444FF">(</font><font color="#2040a0">sol_out</font>, <font color="#008000">&quot;%s.%06d&quot;</font>, <font color="#008000">&quot;vis/ex10.sol&quot;</font>, <font color="#2040a0">mypid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line502">502</a>       <font color="#2040a0">ofstream</font> <font color="#2040a0">sol</font><font color="4444FF">(</font><font color="#2040a0">sol_out</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line503">503</a>       <font color="#2040a0">sol</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#008000">&quot;FiniteElementSpace<font color="#77dd77">\n</font>&quot;</font>
<a name="line504">504</a>           <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#008000">&quot;FiniteElementCollection: H1_2D_P1<font color="#77dd77">\n</font>&quot;</font>
<a name="line505">505</a>           <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#008000">&quot;VDim: 1<font color="#77dd77">\n</font>&quot;</font>
<a name="line506">506</a>           <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#008000">&quot;Ordering: 0<font color="#77dd77">\n</font><font color="#77dd77">\n</font>&quot;</font><font color="4444FF">;</font>
<a name="line507">507</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">numNodes</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line508">508</a>          <font color="#2040a0">sol</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#2040a0">solnValues</font><font color="4444FF">[</font><font color="#2040a0">solnOffsets</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#2040a0">endl</font><font color="4444FF">;</font>
<a name="line509">509</a> 
<a name="line510">510</a>       <font color="#444444">// Save local finite element mesh</font>
<a name="line511">511</a>       <font color="#2040a0">GLVis_PrintLocalSquareMesh</font><font color="4444FF">(</font><font color="#008000">&quot;vis/ex10.mesh&quot;</font>, <font color="#2040a0">n</font>, <font color="#2040a0">m</font>, <font color="#2040a0">h</font>, <font color="#FF0000">0</font>, <font color="#2040a0">mypid</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">*</font><font color="#2040a0">m</font>, <font color="#2040a0">mypid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line512">512</a> 
<a name="line513">513</a>       <font color="#444444">// additional visualization data</font>
<a name="line514">514</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">mypid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line515">515</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line516">516</a>          <strong>char</strong> <font color="#2040a0">data_out</font><font color="4444FF">[</font><font color="#FF0000">20</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line517">517</a>          <font color="#2040a0">sprintf</font><font color="4444FF">(</font><font color="#2040a0">data_out</font>, <font color="#008000">&quot;%s&quot;</font>, <font color="#008000">&quot;vis/ex10.data&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line518">518</a>          <font color="#2040a0">ofstream</font> <font color="#2040a0">data</font><font color="4444FF">(</font><font color="#2040a0">data_out</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line519">519</a>          <font color="#2040a0">data</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#008000">&quot;np &quot;</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#2040a0">nprocs</font> <font color="4444FF">&lt;</font><font color="4444FF">&lt;</font> <font color="#2040a0">endl</font><font color="4444FF">;</font>
<a name="line520">520</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line521">521</a> 
<a name="line522">522</a>       <font color="#444444">// Clean up</font>
<a name="line523">523</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">solnValues</font><font color="4444FF">;</font>
<a name="line524">524</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">solnOffsets</font><font color="4444FF">;</font>
<a name="line525">525</a>       <strong>delete</strong> <font color="4444FF">[</font><font color="4444FF">]</font> <font color="#2040a0">nodeIDList</font><font color="4444FF">;</font>
<a name="line526">526</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line527">527</a>    <strong>delete</strong> <font color="#2040a0">feiPtr</font><font color="4444FF">;</font>
<a name="line528">528</a> 
<a name="line529">529</a>    <font color="#444444">// Finalize MPI</font>
<a name="line530">530</a>    <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line531">531</a> 
<a name="line532">532</a>    <strong>return</strong> <font color="4444FF">(</font><font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line533">533</a> <font color="4444FF"><strong>}</strong></font>

</pre>
<hr>
syntax highlighted by <a href="http://www.palfrader.org/code2html">Code2HTML</a>, v. 0.9.1
</body>
</html>
